package edu.chl.dat255.bluebanana.data;

import android.database.Cursor;

public interface IStorage {

	/**
	 * Delete a profile based on its id.
	 * @param id The profile id.
	 */
	public void deleteProfile(long id);
	/**
	 * Delete all profiles.
	 */
	public void deleteAllProfiles();
	/**
	 * Updates the database value connected to the specified database constant with a new String value.
	 * @param id The profile id.
	 * @param dbconstant The database constant.
	 * @param value The new value.
	 */
	public void updateValue(long id, String dbconstant, String value);
	/**
	 * Updates the database value connected to the specified database constant with a new integer value.
	 * @param id The profile id.
	 * @param dbconstant The database constant.
	 * @param value The new value.
	 */
	public void updateValue(long id, String dbconstant, int value);
	/**
	 * Updates the database value connected to the specified database constant with a new boolean value.
	 * @param id The profile id.
	 * @param dbconstant The database constant.
	 * @param value The new value.
	 */
	public void updateValue(long id, String dbconstant, boolean value);
	/**
	 * Returns the value of the database constant.
	 * @param id The profile id.
	 * @param dbconstant The database constant.
	 * @return The String value for the specified database constant.
	 */
	public String getTextValue(long id, String dbconstant);
	/**
	 * Returns the value of the database constant.
	 * @param id The profile id.
	 * @param dbconstant The database constant.
	 * @return The integer value for the specified database constant.
	 */
	public int getIntValue(long id, String dbconstant);
	/**
	 * Returns the value of the database constant.
	 * @param id The profile id.
	 * @param dbconstant The database constant.
	 * @return The boolean value for the specified database constant.
	 */
	public boolean getBooleanValue(long id, String dbconstant);
	/**
	 * @param id The profile id
	 * @return A the profile as a cursor
	 */
	public Cursor getProfile(long id);
	/**
	 * 
	 * @return All current profiles as a cursor.
	 */
	public Cursor getAllUserProfiles();
	/**
	 * Adds the profile to the database.
	 * @return The id of the added profile
	 */
	public long addProfile();
	/**
	 * Saves the system settings before a profile is activated.
	 * @return The id of the created profile.
	 */
	public long createSystemSettingsProfile();
	/**
	 * 
	 * @return The current default profile as a cursor
	 */
	public Cursor getCurrentSystemProfile();
	/**
	 * 
	 * @return All default profiles as a cursor.
	 */
	public Cursor getAllDefaultProfiles();
	/**
	 * Creates the default profiles and adds them to the database.
	 */
	public void insertDefaultProfiles();
	/**
	 * 
	 * @param id The profile id
	 * @param dbconstant The database constant
	 * @param value The new value
	 */
	public void updateSystemSettingValue(long id, String dbconstant, String value);
	/**
	 * 
	 * @param id The profile id
	 * @param dbconstant The database constant
	 * @param value The new value
	 */
	public void updateSystemSettingValue(long id, String dbconstant, int value);
	/**
	 * 
	 * @param id The profile id
	 * @param dbconstant The database constant
	 * @param value The new value
	 */
	public void updateSystemSettingValue(long id, String dbconstant, boolean value);
	
}
